package com.haoxiaozhang.hxz_app.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.haoxiaozhang.hxz_app.R;
import com.haoxiaozhang.hxz_app.activity.ClockInActivity;
import com.haoxiaozhang.hxz_app.activity.PersonnelManagementActivity;
import com.haoxiaozhang.hxz_app.utils.T;
import com.haoxiaozhang.hxz_app.viewLib.customDialog.CustomDialog;
import com.haoxiaozhang.hxz_app.viewLib.customDialog.DialogCallback;

import androidx.fragment.app.Fragment;

public class HomeFragment extends Fragment {

    RelativeLayout button_daka;
    TextView button_shezhi;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_home, container, false);

        //获取布局元素
        initView(view);

        //绑定事件
        initEvent();

        return view;


    }

    private void initEvent() {

        button_daka.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),ClockInActivity.class);
                startActivity(intent);
            }
        });

        button_shezhi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent intent = new Intent(getActivity(),PersonnelManagementActivity.class);
                startActivity(intent);


//                T.submitDialog(getActivity(), new DialogCallback() {
//                    @Override
//                    public void onSubmit() {
//                        Log.d("TAG","1111111111");
//                    }
//
//                    @Override
//                    public void onCancel() {
//                        Log.d("TAG","2323232332");
//                    }
//
//                });

            }
        });
    }

    private void initView(View v) {

        button_daka = v.findViewById(R.id.button_daka);
        button_shezhi = v.findViewById(R.id.button_shezhi);

    }


}
